package states;

/**
 * Override this and one or more of the Action methods to implement one "State". 
 * entryAction is called when the state is entered, exitAction is called just
 * before the next state is entered.
 * 
 * If you use this interface instead of the State object, be sure to override
 * toString or else logging will look funky.
 * 
 * @author billkress
 */
public interface IState {

    /**
     * @see State.entryAction
     * @param cause The event that caused this state switch
     * @return null unless you wish to force a switch to a new state.
     */
    public IEvent entryAction(IEvent cause);

    /**
     * Like entryAction except that it is called as the engine moves
     * away from this state.  Also, can't return a cause to change
     * which state it's switching to.
     * 
     * @param cause the event that caused the state switch.
     */
    public void exitAction(IEvent cause);
}
